<template>
<div>
  <div v-for="i in list">
    <van-field :label="i.name" v-model="values[i.name]"/>
  </div>
  <van-button @click="tijiao">提交</van-button>


</div>
</template>

<script>
export default {
  name: "yhwork",
  data(){
    return{
      list :[],
      values:{},
      wid:this.$route.query.id,


    }
  },

  methods:{
    get_qj(){
      this.$axios.get('users/setparams?wid='+this.wid).then(res=>{
        this.list = JSON.parse(res.data.list.canshu)
      })
    },

    tijiao(){
      this.$axios.post('users/yhlM',{'uid':1,'wid':this.wid,'pamars':JSON.stringify(this.values)}).then(res=>{
        if (res.data.code==200){
          alert('ok')
          this.values={}
        }else {
          alert('no')
        }
      })
    },

  },
  mounted() {
    this.get_qj()

  }
}
</script>

<style scoped>

</style>
